package com.seanchenxi.gwt.wordpress.json.service.response;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.seanchenxi.gwt.wordpress.json.service.model.Post;

public class JsonPostCallback implements AsyncCallback<PostResponse> {
	
	private AsyncCallback<Post> callback;
	
	public JsonPostCallback(AsyncCallback<Post> callback){
		this.callback = callback;
	}

	@Override
	public void onFailure(Throwable caught) {
		callback.onFailure(caught);
	}

	@Override
	public void onSuccess(PostResponse result) {
		callback.onSuccess(result.getResult());
	}

}
